#pragma once

#include "dib.h"
#include "ref.h"

/** 
 * \ingroup ti6
 *
 * \brief
 * CollectionImage is a simple class which stores the filename of an image,
 * and a thumbnail. It does not create the thumbnails.
 * The CollectionImage class is used by Collection.
 *
 * Copyright (c) Academie voor ICT en Media 2007 - 2008
 */
class CollectionImage
{
public:
	/**
	 \brief
	 Default constructor. Creates an empty instance (which does not contain
	 any image).
	 */
	CollectionImage();

	/**
	 \brief
	 Copy constructor. Creates a copy of the specified collection image.
	 This action will make a shallow copy of the thumbnail.
	 
	 \param CollectionImage& The collection image to copy.
	 */
	CollectionImage( const CollectionImage& );

	/**
	 \brief
	 Destruct the collection image instance.
	 */
	~CollectionImage();

	/**
	 \brief
	 Copy the specified collection image to this instance. This will
	 invalidate the previous contents of this instance.
	 
	 \param CollectionImage& The collection image to copy.
	 \return This instance.
	 */
	CollectionImage& operator =( const CollectionImage& );

	/**
	 \brief
	 Get the file name as a wide character string. This file name must
	 have been set previously using setFileName().
	 
	 \return The file name.
	 */
	wchar_t* fileName() const;

	/**
	 \brief
	 Set the file name as a wide character string.
	 
	 \param *fileName The file name.
	 */
	void setFileName( const wchar_t *fileName );

	/**
	 \brief
	 Get the thumbnail image. This image must have been set previously
	 using setThumbnail().
	 
	 \return The thumbnail.
	 */
	Ref<DIB> thumbnail() const;

	/**
	 \brief
	 Set the thumbnail for this collection image.
	 
	 \param thumbnail The thumbnail.
	 */
	void setThumbnail( Ref<DIB> thumbnail );

private:
	/**
	 The file name of the image, as a wide character string.
	 */
	wchar_t *_fileName;

	/**
	 The thumbnail for this image.
	 */
	Ref<DIB> _thumbnail;
};
